<script setup lang="ts">
import {nextTick, onMounted, reactive, ref} from "vue";
import {Delete} from "@element-plus/icons-vue";
import {dataInsert, dataInfo, dataUpdate} from "@/api/school";
import {schoolColumnList} from "@/api/school-column";
import {ElMessage} from "element-plus";
import UploadDefault from "@/components/UploadFile/UploadDefault.vue";
import {useRoute, useRouter} from "vue-router";
import {useValidator} from "@/hooks/web/useValidator";

const {required} = useValidator()
const router = useRouter()
const route = useRoute()
const rules = {
  'school_ntroduction.school_name': [required()],
  'school_ntroduction.tuition_fee': [required()],
  'school_ntroduction.enrollment_number': [required()],
  'school_ntroduction.school_intro': [required()],
  'school_ntroduction.program_intro': [required()],
  'school_ntroduction.column_id': [required()],
  'school_ntroduction.keywords': [required()],
  'school_ntroduction.description': [required()],
  'school_ntroduction.school_type': [required()],
  'school_ntroduction.school_name_en': [required()],
  'school_ntroduction.admission_requirements': [required()],
  'school_ntroduction.study_country': [required()],
  'school_ntroduction.study_major': [required()],
  'school_ntroduction.application_deadline': [required()],
  'school_ntroduction.school_addr': [required()],
  'school_ntroduction.school_date': [required()],
  'school_ntroduction.phone': [required()],
  'school_ntroduction.school_logo': [required('请上传学校logo图')],
  'school_ntroduction.school_badge': [required('请上传学校校徽')],
}
const formRef = ref('')
const school_logo = ref('')
const school_badge = ref('')
const cover_image_pc = ref('')
const cover_image_mobile = ref('')
const authentication_file = ref('')
const scenery_file = ref('')
const school_intro_file = ref('')
const loading = ref(false)
const submitLoading = ref(false)
const schoolForm = reactive({
  school_ntroduction: {
    ranking: '',
    school_addr: '',
    school_date: '',
    description: '',
    keywords: '',
    column_id: '',
    school_badge: '',
    cover_image_pc: "",
    cover_image_mobile: "",
    phone: '',
    school_logo: "",
    school_type: "",
    school_intro_img: '',
    application_deadline: "",
    tuition_fee: "",
    study_country: "",
    school_intro: "",
    school_name: "",
    school_name_en: '',
    enrollment_number: "",
    admission_requirements: "",
    study_major: "",
    program_intro: ""
  },
  academic_planning: [
    {
      year: '',
      academic_stage: '',
      academic_content: ''
    }
  ],
  major_setting: [
    {
      major_name: "",
      major_name_en: "",
      major_courses: ""
    }
  ],
  target_students: [
    {
      target_students: ""
    }
  ],
  admission_criteria: [
    {
      admission_criteria: ""
    }
  ],
  fee_standard: [
    {
      fee_standard: ""
    }
  ],
  project_advantages: [
    {
      advantage_title: "",
      advantage_intro: ""
    }
  ],
  degree_authentication: [
    {
      file_name: "",
      url: ""
    }
  ],
  study_process: [
    {
      process_title: "",
      process_intro: ""
    }
  ],
  scenery_list: [    //校园风景
    {
      url: '',
    }
  ]
})


const handleSave = () => {
  formRef.value.validate(async valid => {
    if (valid) {
      if (authentication_file.value) {
        authentication_file.value.forEach((item, index) => {
          if (item.fileList.length) {
            schoolForm.degree_authentication[index].url = item.fileList[0].url
          }
        })
      }
      if (scenery_file.value.fileList) {
        schoolForm.scenery_list = scenery_file.value.fileList
      }

      let res: any
      const fieldInfo = [
        {
          field: 'cover_image_pc',
          fileSelector: cover_image_pc,
          message: '请上传PC端封面图',
        },
        {
          field: 'cover_image_mobile',
          fileSelector: cover_image_mobile,
          message: '请上传移动端封面图',
        },
        {
          field: 'school_logo',
          fileSelector: school_logo,
          message: '请上传学校logo图',
        },
        {
          field: 'school_badge',
          fileSelector: school_badge,
          message: '请上传学校校徽',
        },
        {
          field: 'school_intro_file',
          fileSelector: school_intro_file,
          message: '请上传学校介绍图',
        }
      ];
      const isValid = validateAndAssign(fieldInfo, schoolForm.school_ntroduction, ElMessage);
      if (!isValid) return;
      if (school_intro_file.value.fileList.length) {
        schoolForm.school_ntroduction.school_intro_img = school_intro_file.value.fileList[0].url
      }
      submitLoading.value = true
      if (route.query.id) {
        schoolForm.id = route.query.id
        res = await dataUpdate(schoolForm)
      } else {
        res = await dataInsert(schoolForm)
      }
      submitLoading.value = false
      if (res) {
        ElMessage({message: '保存成功', type: 'success'})
        router.back()
      }
    } else {
      return false
    }
  })
}

const validateAndAssign = (fieldInfo, form, messageHandler) => {
  for (const {field, fileSelector, message} of fieldInfo) {
    // 验证条件
    if (!fileSelector.value || !fileSelector.value.fileList || !fileSelector.value.fileList.length) {
      if (message) {
        messageHandler({message, type: 'warning'});
      }
      return false;
    }
    // 赋值操作
    form[field] = fileSelector.value.fileList[0].url;
  }
  return true;
}

const handlePush = (data, length) => {
  if (length) {
    if (data.length >= length) {
      return ElMessage({message: `最多可添加${length}条`, type: 'warning'})
    }
  }
  data.push({})
}

const fetchInfo = async () => {
  loading.value = true
  let res = await dataInfo({id: route.query.id})
  loading.value = false
  console.log('详情数据', res);
  if (res) {
    // 从响应数据中解构出 school_ntroduction 对象
    let {school_ntroduction} = res.data;

    // 定义一个映射对象，键为文件选择器，值为 school_ntroduction 中对应的属性名
    const fieldMapping = {
      'cover_image_pc': 'cover_image_pc',
      'cover_image_mobile': 'cover_image_mobile',
      'school_logo': 'school_logo',
      'school_badge': 'school_badge',
      'school_intro_file': 'school_intro_img'
    };

    // 遍历映射对象
    for (const [fileSelectorKey, fieldKey] of Object.entries(fieldMapping)) {
      // 获取对应的文件选择器对象
      const fileSelector = eval(fileSelectorKey);
      // 检查 school_ntroduction 中对应属性是否存在
      if (school_ntroduction[fieldKey]) {
        // 若存在，则将包含 URL 的对象添加到文件选择器的 fileList 数组中
        fileSelector.value.fileList.push({url: school_ntroduction[fieldKey]});
      }
    }
    nextTick(() => {
      if (res.data.degree_authentication) {
        res.data.degree_authentication.forEach((item, index) => {
          if (item.url) {
            authentication_file.value[index].fileList.push({url: item.url})
          }
        })
      }
      if (res.data.scenery_list) {
        scenery_file.value.fileList = res.data.scenery_list
        scenery_file.value.fileArr = res.data.scenery_list
      }
    })

    Object.assign(schoolForm, res.data)
  }
}

const treeData = ref([])
const getTreeData = async () => {
  let res = await schoolColumnList();
  console.log(res);
  if (res) {
    treeData.value = res.data.list
  }
}

onMounted(() => {
  getTreeData()
  if (route.query.id) {
    fetchInfo()
  }
})
</script>

<template>
  <el-form label-position="left" :model="schoolForm" ref="formRef" :rules="rules"
           label-width="110px" require-asterisk-position="right">
    <el-row justify="center" class="enter-form-wrap" v-loading="loading">
      <el-col :lg="13" :xs="24" :md="24" :sm="20" style="margin-top: 30px;">
        <el-row style="justify-content: space-between;">
          <el-col :span="24">
            <el-divider content-position="left">学校介绍</el-divider>
          </el-col>
          <el-col :lg="24" :xs="24" :md="24" :sm="24">
            <el-form-item label="封面图PC端:" required>
              <upload-default
                  ref="cover_image_pc"
                  :fileType="'picture-card'"
                  :file-style="{width:'200px',height:'150px'}"
                  :file-accept="'.jpg,.png,.jpeg'"
              >
              </upload-default>
            </el-form-item>
          </el-col>
          <el-col :lg="24" :xs="24" :md="24" :sm="24">
            <el-form-item label="封面图移动端:" required>
              <upload-default
                  ref="cover_image_mobile"
                  :fileType="'picture-card'"
                  :file-accept="'.jpg,.png,.jpeg'"
              >
              </upload-default>
            </el-form-item>
          </el-col>
          <el-col :lg="24" :xs="24" :md="24" :sm="24">
            <el-form-item label="学校校徽:" required>
              <upload-default
                  ref="school_badge"
                  :fileType="'picture-card'"
                  :file-accept="'.jpg,.png,.jpeg'"
              >
              </upload-default>
            </el-form-item>
          </el-col>
          <el-col :lg="24" :xs="24" :md="24" :sm="24">
            <el-form-item label="学校Logo:" required>
              <upload-default
                  ref="school_logo"
                  :fileType="'picture-card'"
                  :file-accept="'.jpg,.png,.jpeg'"
              >
              </upload-default>
            </el-form-item>
          </el-col>
          <el-col :lg="24" :xs="24" :md="24" :sm="24">
            <el-form-item label="学校介绍图:" required>
              <upload-default
                  ref="school_intro_file"
                  :fileType="'picture-card'"
                  :file-accept="'.jpg,.png,.jpeg'"
              >
              </upload-default>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="项目关键词:" prop="school_ntroduction.keywords">
              <el-input placeholder="请输入项目关键词 不同关键词使用 , 隔开" type="textarea" :autosize="{minRows: 5}"
                        v-model="schoolForm.school_ntroduction.keywords"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="项目描述:" prop="school_ntroduction.description">
              <el-input placeholder="请输入项目描述" type="textarea" :autosize="{minRows: 5}"
                        maxlength="150"
                        show-word-limit
                        v-model="schoolForm.school_ntroduction.description"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="所属栏目:" prop="school_ntroduction.column_id">
              <el-tree-select
                  v-model="schoolForm.school_ntroduction.column_id"
                  :data="treeData"
                  :props="{ value: 'id', label: 'name' }"
                  check-strictly
                  :render-after-expand="false"
                  style="width:100%;"
              />
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="学校类别:" prop="school_ntroduction.school_type">
              <el-select v-model="schoolForm.school_ntroduction.school_type" style="width: 100%">
                <el-option label="一级落地页" value="1"></el-option>
                <el-option label="二级落地页" value="2"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="联系电话:" prop="school_ntroduction.phone">
              <el-input placeholder="请输入联系电话" v-model="schoolForm.school_ntroduction.phone"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="学校排名:" prop="school_ntroduction.ranking">
              <el-input placeholder="请输入学校排名" v-model="schoolForm.school_ntroduction.ranking"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="学校名称:" prop="school_ntroduction.school_name">
              <el-input placeholder="请输入学校名称" v-model="schoolForm.school_ntroduction.school_name"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="学校英文名称:" prop="school_ntroduction.school_name_en">
              <el-input placeholder="请输入学校英文名称" v-model="schoolForm.school_ntroduction.school_name_en"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="学校地址:" prop="school_ntroduction.school_addr">
              <el-input placeholder="请输入学校地址" v-model="schoolForm.school_ntroduction.school_addr"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="在校时间:" prop="school_ntroduction.school_name_en">
              <el-input placeholder="请输入在校时间" v-model="schoolForm.school_ntroduction.school_date"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="申请截止:" prop="school_ntroduction.application_deadline">
              <el-input placeholder="请输入申请截止时间" v-model="schoolForm.school_ntroduction.application_deadline"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="招生人数:" prop="school_ntroduction.enrollment_number">
              <el-input placeholder="请输入招生人数" v-model="schoolForm.school_ntroduction.enrollment_number"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="学       费:" prop="school_ntroduction.tuition_fee">
              <el-input placeholder="请输入学费" v-model="schoolForm.school_ntroduction.tuition_fee"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="入学要求:" prop="school_ntroduction.admission_requirements">
              <el-input placeholder="请输入入学要求" v-model="schoolForm.school_ntroduction.admission_requirements"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="留学国家:" prop="school_ntroduction.study_country">
              <el-input placeholder="请输入留学国家 不同留学国家使用、隔开"
                        v-model="schoolForm.school_ntroduction.study_country"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="留学专业:" prop="school_ntroduction.study_major">
              <el-input placeholder="请输入留学专业 不同留学专业使用、隔开"
                        v-model="schoolForm.school_ntroduction.study_major"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="学校简介:" prop="school_ntroduction.school_intro">
              <el-input placeholder="请输入学校简介" type="textarea" :autosize="{minRows: 5,maxRows:5}"
                        maxlength="150"
                        show-word-limit
                        v-model="schoolForm.school_ntroduction.school_intro"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="项目介绍:" prop="school_ntroduction.program_intro">
              <el-input placeholder="请输入项目介绍" type="textarea" :autosize="{minRows: 5,maxRows:5}"
                        maxlength="150"
                        show-word-limit
                        v-model="schoolForm.school_ntroduction.program_intro"/>
            </el-form-item>
          </el-col>
        </el-row>
        <!--学业规划 S-->
        <el-row>
          <el-divider content-position="left">
            学业规划
            <span class="hint">提示:最多可添加4条</span>
          </el-divider>
        </el-row>
        <el-row v-for="(item,index) in schoolForm.academic_planning">
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="学年:" prop="year">
              <el-input placeholder="请输入第几学年" v-model="item.year"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11" :offset="1"></el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="学业阶段:" prop="academic_planning">
              <el-input placeholder="请输入国内阶段或者国外阶段" v-model="item.academic_stage"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11" :offset="1"></el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11">
            <el-form-item label="学业内容:" prop="academic_content">
              <el-input placeholder="请输入学业内容" type="textarea" :autosize="{minRows: 4}"
                        maxlength="100"
                        show-word-limit
                        v-model="item.academic_content"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11" :offset="1">
            <el-button v-if="!index" @click="handlePush(schoolForm.academic_planning,4)">添 加</el-button>
            <el-button v-else type="danger" :icon="Delete" circle
                       @click="schoolForm.academic_planning.splice(index,1)"/>
          </el-col>
        </el-row>
        <!--学业规划 E-->
        <!--专业设置 S-->
        <el-row>
          <el-divider content-position="left">专业设置</el-divider>
        </el-row>
        <el-row v-for="(item,index) in schoolForm.major_setting">
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="专业名称:" prop="major_name">
              <el-input placeholder="请输入专业名称" v-model="item.major_name"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11" :offset="1"></el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="专业英文名称:" prop="major_name_en">
              <el-input placeholder="请输入专业英文名称" v-model="item.major_name_en"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11" :offset="1"></el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11">
            <el-form-item label="专业课程:" prop="major_courses">
              <el-input placeholder="请输入部分专业课程" type="textarea" :autosize="{minRows: 3}"
                        v-model="item.major_courses"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11" :offset="1">
            <el-button v-if="!index" @click="handlePush(schoolForm.major_setting,0)">添 加</el-button>
            <el-button v-else type="danger" :icon="Delete" circle @click="schoolForm.major_setting.splice(index,1)"/>
          </el-col>
        </el-row>
        <!--专业设置 E-->
        <!--招生对象  S-->
        <el-row>
          <el-col :span="24">
            <el-divider content-position="left">招生对象</el-divider>
          </el-col>
        </el-row>
        <el-row v-for="(item,index) in schoolForm.target_students">
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="招生对象:" prop="target_students">
              <el-input placeholder="请输入招生对象" v-model="item.target_students"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11" :offset="1">
            <el-button v-if="!index" @click="handlePush(schoolForm.target_students,10)">添 加</el-button>
            <el-button v-else type="danger" :icon="Delete" circle @click="schoolForm.target_students.splice(index,1)"/>
          </el-col>
        </el-row>
        <!--招生对象  E-->
        <!--录取要求  S-->
        <el-row>
          <el-col :span="24">
            <el-divider content-position="left">
              录取要求
              <span class="hint">提示:最多可添加3条</span>
            </el-divider>
          </el-col>
        </el-row>
        <el-row v-for="(item,index) in schoolForm.admission_criteria">
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="录取要求:" prop="admission_criteria">
              <el-input placeholder="请输入录取要求" :autosize="{minRows: 3}" type="textarea"
                        v-model="item.admission_criteria"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11" :offset="1">
            <el-button v-if="!index" @click="handlePush(schoolForm.admission_criteria,3)">添 加</el-button>
            <el-button v-else type="danger" :icon="Delete" circle
                       @click="schoolForm.admission_criteria.splice(index,1)"/>
          </el-col>
        </el-row>
        <!--录取要求  E-->
        <!--收费标准  S-->
        <el-row>
          <el-col :span="24">
            <el-divider content-position="left">收费标准</el-divider>
          </el-col>
        </el-row>
        <el-row v-for="(item,index) in schoolForm.fee_standard">
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="收费标准:" prop="fee_standard">
              <el-input placeholder="请输入收费标准" type="textarea" :autosize="{minRows: 3}"
                        v-model="item.fee_standard"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11" :offset="1">
            <el-button v-if="!index" @click="handlePush(schoolForm.fee_standard,0)">添 加</el-button>
            <el-button v-else type="danger" :icon="Delete" circle @click="schoolForm.fee_standard.splice(index,1)"/>
          </el-col>
        </el-row>
        <!--收费标准  E-->
        <!--项目优势  S-->
        <el-row>
          <el-col :span="24">
            <el-divider content-position="left">
              项目优势
              <span class="hint">提示:最多可添加8条</span>
            </el-divider>
          </el-col>
        </el-row>
        <el-row v-for="(item,index) in schoolForm.project_advantages">
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="优势标题:" prop="advantage_title">
              <el-input placeholder="请输入优势标题" v-model="item.advantage_title" maxlength="11" show-word-limit/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="优势介绍:" prop="advantage_intro">
              <el-input placeholder="请输入优势介绍" :autosize="{minRows: 4}" type="textarea"
                        maxlength="60"
                        show-word-limit
                        v-model="item.advantage_intro"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11" :offset="1">
            <el-button v-if="!index" @click="handlePush(schoolForm.project_advantages,8)">添 加
            </el-button>
            <el-button v-else type="danger" :icon="Delete" circle
                       @click="schoolForm.project_advantages.splice(index,1)"/>
          </el-col>
        </el-row>
        <!--项目优势  E-->
        <!--学历认证  S-->
        <el-row>
          <el-col :span="24">
            <el-divider content-position="left">
              学历认证
              <span class="hint">提示:最多可添加4条</span>
            </el-divider>
          </el-col>
        </el-row>
        <el-row v-for="(item,index) in schoolForm.degree_authentication">
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="文件名称:" prop="name">
              <el-input placeholder="请输入文件名称" v-model="item.file_name"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11" :offset="1">
            <el-button v-if="!index" @click="handlePush(schoolForm.degree_authentication,4)">添 加</el-button>
            <el-button v-else type="danger" :icon="Delete" circle
                       @click="schoolForm.degree_authentication.splice(index,1)"/>
          </el-col>
          <el-col :lg="24" :xs="24" :md="11" :sm="11">
            <el-form-item label="" prop="name">
              <upload-default
                  ref="authentication_file"
                  :fileType="'picture-card'"
                  :file-accept="'.jpg,.png,.jpeg'"
              >
              </upload-default>
            </el-form-item>
          </el-col>
        </el-row>
        <!--学历认证  E-->
        <!--学习流程  S-->
        <el-row>
          <el-col :span="24">
            <el-divider content-position="left">
              学习流程
              <span class="hint">提示:最多可添加6条</span>
            </el-divider>
          </el-col>
        </el-row>
        <el-row v-for="(item,index) in schoolForm.study_process">
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="流程标题:" prop="process_title">
              <el-input placeholder="请输入流程标题" v-model="item.process_title"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
          </el-col>
          <el-col :lg="11" :xs="24" :md="11" :sm="11">
            <el-form-item label="流程介绍:" prop="process_intro">
              <el-input placeholder="请输入流程介绍" :autosize="{minRows: 4}" type="textarea"
                        maxlength="55"
                        show-word-limit
                        v-model="item.process_intro"/>
            </el-form-item>
          </el-col>
          <el-col :lg="11" :xs="24" :md="24" :sm="11" :offset="1">
            <el-button v-if="!index" @click="handlePush(schoolForm.study_process,6)">添 加</el-button>
            <el-button v-else type="danger" :icon="Delete" circle @click="schoolForm.study_process.splice(index,1)"/>
          </el-col>
        </el-row>
        <el-row v-show="schoolForm.school_ntroduction.school_type == 2">
          <el-col :lg="24" :xs="24" :md="24" :sm="24">
            <el-form-item label="校园风景:" prop="realname">
              <upload-default
                  :limit="10"
                  ref="scenery_file"
                  :fileType="'picture-card'"
                  :file-accept="'.jpg,.png,.jpeg'"
              >
              </upload-default>
            </el-form-item>
          </el-col>
        </el-row>
        <!--学习流程  E-->
        <el-row style="margin-top: 30px">
          <el-col :lg="24">
            <el-form-item>
              <el-button type="primary" @click="handleSave" :loading="submitLoading">保 存</el-button>
              <el-button @click="router.back()">返 回</el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-col>
    </el-row>
  </el-form>
</template>

<style scoped lang="less">
.hint {
  color: #F56C6C;
  margin-left: 20px;
  font-weight: bold;
}

.enter-form-wrap {
  background-color: #fff;
  border-radius: 3px;
  padding: 0 10px 50px;
}

</style>